package com.csun.cmny.provider.vo;

import com.csun.cmny.provider.validator.OmcMonitorLogValidator;
import lombok.Data;
import org.hibernate.validator.constraints.NotEmpty;

import javax.persistence.Id;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.util.Date;

@Data
public class OmcMonitorLogVo {
    /**
     * 班长日志id
     */
    @Id
    private Integer id;

    /**
     * 组织Id
     */
    private Long groupId;

    /**
     * 版本号
     */
    private Integer version;

    /**
     * 老人id
     */
    @NotNull(message = "{id.empty}",groups = {OmcMonitorLogValidator.class})
    private Integer oldManId;

    /**
     * 时间 2018-04-04
     */
    @Size(min = 1, max = 10, message = "{Monitorlog.date.length.error}",groups = {OmcMonitorLogValidator.class})
    @Pattern(regexp="^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])"
            + "|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|"
            + "[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)$",
            message="{Advisory.date.pattem.error}",
            groups = {OmcMonitorLogValidator.class})
    private String date;

    /**
     * 时间段 06:00:00-23:00:00
     */
    @Size(min = 1, max = 20, message = "{Monitorlog.date.length.error}",groups = {OmcMonitorLogValidator.class})
    @Pattern(regexp="^([0-1]?[0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])-([0-1]?[0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$",
            message="{Advisory.date.pattem.error}",
            groups = {OmcMonitorLogValidator.class})
    private String period;

    /**
     * 地点
     */
    @NotEmpty(message = "{Monitorlog.address.notnull}", groups = {OmcMonitorLogValidator.class})
    @Size(min = 1, max = 32, message = "{Monitorlog.address.length}", groups = {OmcMonitorLogValidator.class})
    private String place;

    /**
     * 发生事件
     */
    @NotEmpty(message = "{Monitorlog.fasheng.notnull}", groups = {OmcMonitorLogValidator.class})
    @Size(min = 1, max = 256, message = "{Monitorlog.fasheng.length}", groups = {OmcMonitorLogValidator.class})
    private String event;

    /**
     * 原因
     */
    @NotEmpty(message = "{Monitorlog.reason.notnull}", groups = {OmcMonitorLogValidator.class})
    @Size(min = 1, max = 256, message = "{Monitorlog.reason.length}", groups = {OmcMonitorLogValidator.class})
    private String reason;

    /**
     * 如何处理
     */@NotEmpty(message = "{Monitorlog.chuli.notnull}", groups = {OmcMonitorLogValidator.class})
    @Size(min = 1, max = 256, message = "{Monitorlog.chuli.length}", groups = {OmcMonitorLogValidator.class})

    private String handle;

    /**
     * 负责人
     */
    @NotNull(message = "{id.empty}",groups = {OmcMonitorLogValidator.class})
    private Integer userId;

    /**
     * 护工组id
     */
    private Integer nursingGroupId;

    /**
     * 创建人
     */
    private String creator;

    /**
     * 创建人ID
     */
    private Long creatorId;

    /**
     * 创建时间
     */
    private Date createdTime;

    /**
     * 最近操作人
     */
    private String lastOperator;

    /**
     * 最后操作人ID
     */
    private Long lastOperatorId;

    /**
     * 更新时间
     */
    private Date updateTime;

    /**
     * 备注
     */
    private String remark;


    private  String userName;

    private  String oldName;

}